<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>
		<meta charset="utf-8">
		<title>结果页</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="/layui/css/layui.css" media="all">

	</head>
	<body class="layui-layout-body">
	<div class="layui-fluid" style="padding-top: 20px">
		<div class="layui-row layui-col-space15">
			<div th:each="policy : ${policyList}" th:id=" 'policy'+${policy.id}" class="layui-col-md12">
				<div class="layui-card">
					<div  class="layui-card-body">
						<h2  th:text="${policy.title}">标题</h2>
						<div  th:text="${#dates.format(policy.publishTime, 'yyyy-MM-dd')}">2020-10-25</divclas>
					</div>
					
				</div>
			</div>

		</div>
	</div>
		<script src="/layui/layui.js"></script>
		<script th:inline="javascript">

			var policyList = [[${policyList}]];
			layui.use([ 'jquery', 'layer'], function () {
				var $ = layui.jquery,
						laydate = layui.laydate,
						layer = layui.layer

				$.each(policyList,function(index,item){
					$('#policy'+item.id).click(function () {
						console.log(item.content)
						layer.open({
							type: 2,
							title: '政策详情',
							shadeClose: true,
							shade: 0.8,
							area: ['800px', '90%'],
							content: '/tFile/preFile/'+item.id //iframe的url
						});
					})
				})
			});
		</script>

	</body>
</html>
